﻿<?xml version="1.0" encoding="utf-8" ?>
<AdoNetDataAccess connection="$UserManagementDBConnection$" formatter="bizobj of UserGroup(appPrivileges)">
	<Sql>
		SELECT 
			@userGroupId as id, g.name, g.description, g.dateCreated, g.dateUpdated, g.lastUpdateBy, g.createdBy, g.autoNotify, g.systemType,
			g.companyId, p.id AS appPrivilegesid, p.privilegeLevel as appPrivilegesprivilege
		FROM
		   UserGroup AS g 
		FULL OUTER JOIN 
			PrivilegeLevel AS p ON g.id = p.userGroupId
		WHERE 
			g.id = @userGroupId or p.userGroupId = @userGroupId
	</Sql>
	<Param name="userGroupId" type="UniqueIdentifier"/>
</AdoNetDataAccess>